/**
 * @format
 */

import React from 'react';
import { AppRegistry, Text, Platform, LogBox, TextInput } from 'react-native';
import { name as appName } from './app.json';
import App from './src/App';


LogBox.ignoreLogs([
    'key" prop is being spread into JSX',
    'Non-serializable values were found in the navigation state. Check:',
    'Warning: Something is calling a React component directly.',
    'VirtualizedLists should never be nested inside plain ScrollViews',
    'ViewPager: Calling `getNode()` on the ref of an Animated component is no longer necessary.',
    'Remote debugger is in a background tab which may cause apps to perform slowly.',
]);

const defaultFontFamily = {
    ...Platform.select({
        android: { fontFamily: '', color: 'black', },
    }),
};
// 解决小米的辣鸡问题
const oldRender = Text.render;
Text.render = function (...args) {
    const origin = oldRender.call(this, ...args);
    return React.cloneElement(origin, {
        style: [defaultFontFamily, origin.props.style],
    });
};
Text.defaultProps = {
    ...(Text.defaultProps || {}),

    allowFontScaling: false,
};

TextInput.defaultProps = {
    ...(TextInput.defaultProps || {}),
    allowFontScaling: false,
};
// messaging().setBackgroundMessageHandler(async remoteMessage => {
//     console.log('Message handled in the background!', remoteMessage);
// });
AppRegistry.registerHeadlessTask('RNCallKeepBackgroundMessage', () => ({ name, callUUID, handle }) => {
    return Promise.resolve();
});
AppRegistry.registerComponent(appName, () => App);
